/**  拼接数组 */
const arr = [1, 2, 3];
console.log(arr.concat([4, 5, 6]));
/**
 *
 * @param  {...number[]} arr
 * @returns {number[]}
 */
function myConcat(...arr) {
  let res = [];
  this.forEach((item) => {
    res.push(item);
  });
  arr.forEach((subArr) => {
    subArr.forEach((item) => {
      res.push(item);
    });
  });
  return res;
}

Array.prototype.myConcat = myConcat;

console.log(arr.myConcat([4, 5, 6], [7, 8, 9]));
